<?php

namespace Pinenut\Form;

use Pinenut\Model2\Finder;
use \Model as BaseModel;

class Model extends BaseModel {
	public static $collection = 'Forms';
	public $formId;
	public $formFields;
	
	/**
	 * код для защиты от csrf
	 *
	 * @var string
	 */
	public $code;
	static function fields() {
		return array_merge ( parent::fields (), [ 
				'formId' => self::STRING,
				'formFields' => self::MIXED,
				'code' => self::STRING 
		] );
	}
	
	/**
	 * Индексируем идентификатор формы
	 */
	function indexes() {
		return array_merge ( parent::indexes (), [ 
				'id' => [ 
						'formId' => Finder::ORDER_ASC 
				] 
		] );
	}
}